package info.mikrotubula.agents;

import info.mikrotubula.db.Images;
import info.mikrotubula.db.Users;
import info.mikrotubula.db.Works;
import info.mikrotubula.managers.ImagesManagerLocal;
import javax.ejb.EJB;

/**
 *
 * @author Krystian
 */
public class ImagesAgent {


    
    @EJB
    private ImagesManagerLocal imagesManagerBean;
    private Integer imagePhase;
    private String imageName;
    private String imageSource;
    private Works work;
    private SessionsAgent sessionAgent;
    
    /** Creates a new instance of ImagesAgent */
    public ImagesAgent() {
    }

    public void create() {
        Users user = sessionAgent.getActiveSession().getUser();
        imagesManagerBean.create(getImagePhase(), getImageName(), user);
    }
    
    public String display(String name) {
        Users user = new Users();
        user.setUsrId(0);
        return imagesManagerBean.display(user, name);
    }
    
    public Integer getImagePhase() {
        return imagePhase;
    }

    public void setImagePhase(Integer imagePhase) {
        this.imagePhase = imagePhase;
    }

    public Works getWork() {
        return work;
    }

    public void setWork(Works work) {
        this.work = work;
    }

    public String getImageName() {
        return imageName;
    }

    public void setImageName(String imageName) {
        this.imageName = imageName;
    }

    public String getImageSource() {
        return imageSource;
    }

    public void setImageSource(String imageSource) {
        this.imageSource = imageSource;
    }
    
}
